<?php

namespace App\Http\Models\Business;

use App\Http\Models\BaseModel;

class Material extends BaseModel
{
    protected $table = 'material';

    protected $fillable = [
        'year',
        'material',
        'material_desc',
        'category_small_id',
        'category_big_id',
        'category_contract_id',
        'category_key_product_id',
        'is_special_offer'
    ];


    public function category_small()
    {
        return $this->belongsTo('App\Http\Models\CategorySmall', 'category_small_id', 'id');
    }

    public function category_big()
    {
        return $this->belongsTo('App\Http\Models\CategoryBig', 'category_big_id', 'id');
    }

    public function category_contract()
    {
        return $this->belongsTo('App\Http\Models\CategoryContract', 'category_contract_id', 'id');
    }

    public function category_key_product()
    {
        return $this->belongsTo('App\Http\Models\CategoryKeyProduct', 'category_key_product_id', 'id');
    }
}
